<?php

namespace app\index\controller;
use app\common\model\jooj_common\Regions as RegionsModel;

class Baseinfo extends \app\common\controller\AuthBase {

    public function __construct() {
        parent::__construct();
    }

 
    /**
     * 获取中国所有城市
     */
    public function getCity() {
        $RegionsModel = new RegionsModel();
        $res = $RegionsModel->get_city();
        return $this->output($res);
    }
    /**
     * 根据城市名获取城市id
     */
    public function getCityIdByCityName() {
        $params = $this->input();

        $param_list = [
            'city_name' => 'string'
        ];
        $this->diffParam($param_list, $params);
        $RegionsModel = new RegionsModel(); 
        $res = $RegionsModel->get_city_id_by_city_name($params['city_name']);
        return $this->output($res);
    }
    
}
